package com.ssy.lingxi.product.api.hystrix;

import com.ssy.lingxi.common.response.ResponseCode;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.product.api.feign.FreightSpaceControllerFeign;
import com.ssy.lingxi.product.api.model.request.warehouse.InventoryByProductIdRequest;
import org.springframework.stereotype.Component;

@Component
public class FreightSpaceControllerFallback implements FreightSpaceControllerFeign {
    /**
     * 扣除仓位库存
     *
     * @param request 接口参数
     */
    @Override
    public Wrapper<Void> deductInventory(InventoryByProductIdRequest request) {
        return Wrapper.fail(ResponseCode.SERVICE_PRODUCT_ERROR);
    }

    /**
     * 返回库存
     *
     * @param request 接口参数
     */
    @Override
    public Wrapper<Void> deductReturn(InventoryByProductIdRequest request) {
        return Wrapper.fail(ResponseCode.SERVICE_PRODUCT_ERROR);
    }

    /**
     * 查询商品的仓位库存-内部
     */
    @Override
    public Wrapper<Double> stockByProductIdInside(Long productId, Long shopId, Long memberId, Long memberRoleId) {
        return Wrapper.fail(ResponseCode.SERVICE_PRODUCT_ERROR);
    }
}
